var sendPeoInfoDom = `
    <div>
        <div id='mask' style='z-index:102' v-if='offShow'></div>

        <transition enter-active-class='animated bounceIn' leave-active-class='animated bounceOut'>
            <div v-if='offShow' class='go-out-com'>
                 <div class='close-notice-com' style='height:730px;'>
                    <div class='close-img-com' @click='offShow=false;'></div>
                    <div class='send-get-address-com'>
                        <img src='./static/img/send-get.png' width='150px' height='192px' />
                        <img :src='send_font.img' style='margin-top:15px;margin-bottom:30px;' />
                        <input type='text' v-model='info.name' :placeholder='send_font.pl1' />
                        <input type='text' v-model='info.phone' :placeholder='send_font.pl2' />
                        <input type='text' v-model='info.address' :placeholder='send_font.pl3' />
                    </div>
                    <div class='close-btn-sure'>
                        <button @click='sureControll'>确认提交</button>
                    </div>
                </div>
            </div>
        </transition>
    </div>
    
`;

Vue.component('send-people-info', {
    data: function() {
        return {
            //控制显示隐藏
            offShow: false,
            info: {
                name: '',
                phone: '',
                address: ''
            }
        }
    },
    props: ['send_font'],
    template: sendPeoInfoDom,
    methods: {
        sureControll: function() {
            if (!this.info.name.trim()) {
                _layer('请输入姓名');
                return;
            }
            if (!this.checkMobile(this.info.phone)) {
                return;
            }
            if (!this.info.address.trim()) {
                _layer('请输入真实地址');
                return;
            }
            this.offShow = false;
            this.$emit('sendaddressinfo', this.info);
        },
        //验证手机号正则
        checkMobile: function(sMobile) {
            if (!(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(sMobile))) {
                _layer('请输入正确的手机号');
                return false;
            } else {
                return true;
            }
        },
    }
});